var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
var Result = [{

}]
$.ajax({
    type: 'GET',
    url: "../flare.json",
    data: {action: "jQueryAjax"},
    async:false,
    success: function (Result) {
        Result = Result
    },
    dataType: "json"
});
console.log(Result);
myChart.showLoading();
        $.get(Result, function (data) {
            myChart.hideLoading();
            data.children.forEach(function (datum, index) {
                index % 2 === 0 && (datum.collapsed = true);
            });
            myChart.setOption(
                (option = {
                    tooltip: {
                        trigger: 'item',
                        triggerOn: 'mousemove'
                    },
                    series: [
                        {
                            type: 'tree',
                            data: [data],
                            top: '1%',
                            left: '15%',
                            bottom: '1%',
                            right: '7%',
                            symbolSize: 7,
                            orient: 'RL',
                            label: {
                                position: 'right',
                                verticalAlign: 'middle',
                                align: 'left'
                            },
                            leaves: {
                                label: {
                                    position: 'left',
                                    verticalAlign: 'middle',
                                    align: 'right'
                                }
                            },
                            emphasis: {
                                focus: 'descendant'
                            },
                            expandAndCollapse: true,
                            animationDuration: 550,
                            animationDurationUpdate: 750
                        }
                    ]
                })
            );
        });

        option && myChart.setOption(option);